package main

import "fmt"

const (
	GRAPH_F_MISS uint32 = 1 << iota	//1
	GRAPH_F_ERR			//2
	GRAPH_F_SENDING		//4
	GRAPH_F_FETCHING		//8
)

func main() {
	fmt.Println(GRAPH_F_MISS, GRAPH_F_ERR, GRAPH_F_SENDING, GRAPH_F_FETCHING)
	fmt.Println(0&1)		//0
	fmt.Println(1&1)		//1
	fmt.Println(2&1)		//0
	fmt.Println(4&1)		//0
	fmt.Println(8&1)		//0
	flag := 1
	flag &= ^4      //等价于 flag = flag ^(flag&4)
	fmt.Println(1|4)		//5
	fmt.Println(5&1)		//1
	fmt.Println(flag)			//1
	//fmt.Println(9|8)
}

//位运算有三种：与(&)、或(|)、异或(^)
